<?php

defined( '_JEXEC' ) or die( 'Restricted access' );
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');

?>
<script type="text/javascript">
                    
	function checkForm(frm){
		if(frm.cpass.value == "")
		{
			alert('<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASS_ALERT_INPUT_CURRENT_PASS') ?>');
			frm.cpass.focus();
			return false;
		}
		
		if(frm.npass.value == "")
		{
			alert('<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASS_ALERT_INPUT_NEW_PASS') ?>');
			frm.cpass.focus();
			return false;
		}
		
		if(frm.npass.value != frm.npassr.value)
		{
			alert('<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASS_ALERT_INPUT_THE_SAME_PASS') ?>');
			frm.npassr.focus();
			return false;
		}
		
	    return true;
	}
</script>

<div class="row">
	<div class="twelve columns all_reward_header">
		<?php echo JTEXT::_('WRD_MYACCOUNT_CHANGE_PASSWORD')?>
	</div>
</div>

<jdoc:include type="message" />

<form onsubmit="return checkForm(this);" action="<?php echo JRoute::_('index.php'); ?>" method="post" id="form_change_pass" class="form" >	

	<table width="100%" id="default_registration_form" cellpadding="5" cellspacing="0" class="tbl_registration">		
	
		<tr>
			<td>
				<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASSWORD_CURRENT_PASS')?>
			</td>		
			<td>
				<input class="text_box" id="modlgn-username" 
						type="password" maxlength="50" size="50" 
						value="" name="cpass">
			</td>		
		</tr>	
		<tr>
			<td>
				<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASSWORD_NEW_PASS')?>
			</td>		
			<td>
				<input class="text_box" id="modlgn-username" 
						type="password" maxlength="50" size="50" 
						value="" name="npass">
			</td>		
		</tr>
	
		<tr>
			<td>
				<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASSWORD_NEW_PASS_REPEAT')?>
			</td>		
			<td>
				<input class="text_box" id="modlgn-username" 
						type="password" maxlength="50" size="50" 
						value="" name="npassr">
			</td>		
		</tr>
		
		
		<tr>			
			<td>				
	
				<input type="submit" value="<?php echo JText::_('WRD_MYACCOUNT_CHANGE_PASSWORD_NEW_PASS_REPEAT_SUBMIT') ?>" name="submit" class="button_submit" />				
				<input type="hidden" name="option" value="com_wrd" />				
				<input type="hidden" name="task" value="profile.changepass" />				
				<input type="hidden" name="return" value="index.php" />				
				<?php echo JHtml::_('form.token'); ?>			
			</td>		
		</tr>	
	</table>
</form>	